﻿namespace Blaze.Framework.MonoEventListeners
{
    using UnityEngine;

    public class GUI : MonoBehaviour
    {
        public event EventHandler OnGUIEvent;

        public static GUI Get(GameObject obj)
        {
            return obj.GetOrAddComponent<GUI>();
        }

        private void OnGUI()
        {
            if (OnGUIEvent != null)
                OnGUIEvent(gameObject);
        }
    }
}